package com.telnetnz.ticketdesk.bean;

import java.util.List;
import java.util.Map;

import org.springframework.beans.BeanUtils;

import com.rockbb.common.simpleframe.config.SimpleConfig;
import com.rockbb.common.utilities.i18n.Language;
import com.telnetnz.ticketdesk.bean.misc.ComparableObject;
import com.telnetnz.ticketdesk.bean.misc.OperationLogObject;
import com.telnetnz.ticketdesk.dao.entity.MemberEntity;

public class Member extends MemberEntity implements OperationLogObject, ComparableObject
{
	private static final long serialVersionUID = 3894623997010676850L;

	public Language getLanguageObj()
	{
		return SimpleConfig.getLanguages().get(getLanguage());
	}

	public List<OperationLog> getOperationLogs()
	{
		return null;
	}

	public static Member adapt(MemberEntity entity) 
	{
		if (entity == null)
			return null;
		Member bean = new Member();
		BeanUtils.copyProperties(entity, bean);
		return bean;
	}

	public MemberEntity toEntity()
	{
		return this;
	}

	public Map<String, List<String>> compare()
	{
		return null;
	}

	public String getObjectName() {
		return this.getName();
	}

	public String getObjectSummary() {
		return this.getFirstname() + " " + this.getLastname() + ", " + this.getEmail();
	}
}